﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace OrderingPlatform.Model.UserManage
{
    public class RegisterModel
    {
        [Required(ErrorMessage = "用户名不能为空")]
        [DisplayName("用户名：")]
        public string UserCode { get; set; }
        [Required(ErrorMessage = "密码不能为空")]
        [DataType(DataType.Password)]
        [DisplayName("密　码：")]
        public string Password { get; set; }

        [Required(ErrorMessage = "确认密码不能为空")]
        [DataType(DataType.Password)]
        [DisplayName("确认密码：")]
        public string ConfirmPassword { get; set; }
        [Required(ErrorMessage = "电子邮箱不能为空")]
        [RegularExpression(@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", ErrorMessage = "电子邮箱应该为xxx@xx.com形式")]
        [DisplayName("电子邮箱：")]
        public string Email { get; set; }
        [Required(ErrorMessage = "注册类别必选")]
        [DisplayName("注册类别：")]
        public string Category { get; set; }
    }
}
